Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pWn3d1337 committed Feb 1, 2019
1 parent 35a3cb0 commit 8bb06d2
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.12.2-2.0.1.3"
version = "1.12.2-2.0.2.0"
group = "techguns" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "techguns"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum EnumOreDrillType implements IStringSerializable, IMachineType<EnumOr
ROD(2,OreDrillTileEntSlave.class,true,EnumBlockRenderType.MODEL),
ENGINE(3,OreDrillTileEntSlave.class,true,EnumBlockRenderType.MODEL),
CONTROLLER(4,OreDrillTileEntMaster.class,true,EnumBlockRenderType.MODEL),
SCAFFOLD_HIDDEN(5,OreDrillTileEntSlave.class,true,EnumBlockRenderType.INVISIBLE,BlockRenderLayer.CUTOUT,SoundType.METAL, true)
SCAFFOLD_HIDDEN(5,OreDrillTileEntSlave.class,false,EnumBlockRenderType.INVISIBLE,BlockRenderLayer.CUTOUT,SoundType.METAL, true)
;

private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public static int[] getNextBlockInDirOffset(int x, int y, int z, EnumFacing dir,
return pos;
}

@Override
public boolean isGlobalRenderer(OreDrillTileEntMaster te) {
return te.isFormed();
}

protected void drawDriller(OreDrillTileEntMaster tile, OreDrillCube cube, Tessellator tess){

int length = tile.getRods();
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/techguns/gui/OreDrillGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,31 @@ protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
this.fontRenderer.drawString(s1, startx-16+30, 44-20, red);
//this.fontRenderer.drawString(s2, startx2-16, 52, red);
} else {
if(tile.getDrillItemMiningLevel()<0) {

int rad = tile.getDrillRadius();
String s1="2";
if(rad==0) {
s1="0";
} else if(rad==1 || rad==2) {
s1="1";
}
String s2= TextUtil.trans("techguns.container.oredrill.drillrequired."+s1);

//String s2= TextUtil.trans("techguns.container.oredrill.broken2");
int startx = this.xSize/2 - ((s2.length()*6)/2);
//int startx2 = this.xSize/2 - ((s2.length()*6)/2);

int red = 0xFFFF2020;

this.fontRenderer.drawString(s2, startx-16+30, 44-20, red);
}
//this.fontRendererObj.drawString(TextUtil.trans("techguns.MULTIBLOCK OK"), 50, 24, 4210752);
}

if (this.isInRect(mx, my, 74, 16, 27, 39)){
List<String> tooltip = new ArrayList<String>();

tooltip.add(String.format("%.2f",(this.tile.progress*1.0f/this.tile.totaltime*100.0f))+"%");
tooltip.add(TextUtil.trans("techguns.gui.oredrill.orehour")+": "+String.format("%.2f",1200.0/this.tile.totaltime*60.0));
if(this.tile.getPowerPerTick()>0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public OreDrillContainer(InventoryPlayer player, OreDrillTileEntMaster ent) {
if (inventory instanceof ItemStackHandlerPlus) {
ItemStackHandlerPlus handler = (ItemStackHandlerPlus) inventory;

this.addSlotToContainer(new SlotDrill(handler, OreDrillTileEntMaster.SLOT_DRILL, SLOT_DRILL_X, SLOTS_ROW1_Y));
this.addSlotToContainer(new SlotDrill(handler, OreDrillTileEntMaster.SLOT_DRILL, SLOT_DRILL_X, SLOTS_ROW1_Y, tile));
this.addSlotToContainer(new SlotFurnaceFuelTG(handler, OreDrillTileEntMaster.SLOT_FURNACE, SLOT_DRILL_X, SLOTS_FURNACE_Y));

for (int i=0;i<3;i++){
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/techguns/gui/widgets/SlotDrill.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@
import net.minecraft.item.ItemStack;
import techguns.api.tginventory.ITGSpecialSlot;
import techguns.api.tginventory.TGSlotType;
import techguns.tileentities.OreDrillTileEntMaster;
import techguns.tileentities.operation.ItemStackHandlerPlus;
import techguns.tileentities.operation.ReactionBeamFocus;

public class SlotDrill extends SlotMachineInput {

public SlotDrill(ItemStackHandlerPlus itemHandler, int index, int xPosition, int yPosition) {
OreDrillTileEntMaster tile;

public SlotDrill(ItemStackHandlerPlus itemHandler, int index, int xPosition, int yPosition, OreDrillTileEntMaster tile) {
super(itemHandler, index, xPosition, yPosition);
this.tile=tile;
}

@Override
public boolean isItemValid(ItemStack item) {
if(!tile.isFormed()) return false;
if(!item.isEmpty() && item.getItem() instanceof ITGSpecialSlot) {
int radius = tile.getDrillRadius();

ITGSpecialSlot itm = (ITGSpecialSlot) item.getItem();
return itm.getSlot(item)==TGSlotType.DRILL_SMALL || itm.getSlot(item)==TGSlotType.DRILL_MEDIUM || itm.getSlot(item)==TGSlotType.DRILL_LARGE;
return (itm.getSlot(item)==TGSlotType.DRILL_SMALL && radius==0) || (itm.getSlot(item)==TGSlotType.DRILL_MEDIUM && radius>0 && radius<3) || (itm.getSlot(item)==TGSlotType.DRILL_LARGE && radius >=3);
}
return false;
}
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/techguns/tileentities/OreDrillTileEntMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class OreDrillTileEntMaster extends MultiBlockMachineTileEntMaster implem

public OreDrillTileEntMaster() {
super(11, 500000);

this.inventory = new ItemStackHandlerPlus(11) {

@Override
Expand Down Expand Up @@ -157,11 +157,13 @@ public ITextComponent getDisplayName() {
public AxisAlignedBB getRenderBoundingBox() {
if(this.isFormed()) {
BlockPos p = this.getPos();
BlockPos rod_end = this.getPos().offset(drill_direction, rods+engines);
BlockPos rod_end = this.getPos().offset(drill_direction, rods+engines+1);

BlockPos other = rod_end.offset(OreDrillDefinition.getSide2(drill_direction), +radius+2);
BlockPos first = p.offset(OreDrillDefinition.getSide1(drill_direction), -radius-2);
BlockPos other = rod_end.offset(OreDrillDefinition.getSide1(drill_direction), +(radius+2)).offset(OreDrillDefinition.getSide2(drill_direction), +(radius+1));
BlockPos first = p.offset(OreDrillDefinition.getSide1(drill_direction), -(radius+2)).offset(OreDrillDefinition.getSide2(drill_direction), -(radius+1));
//System.out.println("BB:"+first.toString()+"->"+other.toString());
return new AxisAlignedBB(first,other);
//return super.getRenderBoundingBox().expand(50, 50, 50);*/
} else {
return super.getRenderBoundingBox();
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/assets/techguns/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -755,4 +755,7 @@ item.techguns.rocket_high_velocity.name=§eRocket (High Velocity)
techguns.container.blast_furnace=Blast Furnace
techguns.tooltip.duration=Duration
techguns.tooltip.ticks=ticks
tile.techguns.simplemachine.11.name=Blast Furnace
tile.techguns.simplemachine.11.name=Blast Furnace
techguns.container.oredrill.drillrequired.0=Requires Small Drill
techguns.container.oredrill.drillrequired.1=Requires Medium Drill
techguns.container.oredrill.drillrequired.2=Requires Large Drill

0 comments on commit 8bb06d2

Please sign in to comment.