Added icons for armor slots in MFE\MFSU\etc.
This commit is contained in:
parent
c0a43c0947
commit
5974ae094d
4 changed files with 19 additions and 69 deletions
|
@ -35,58 +35,16 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
@SideOnly(Side.CLIENT)
|
||||
public class IconSupplier {
|
||||
public static TextureAtlasSprite armour_head;
|
||||
public static TextureAtlasSprite armour_chest;
|
||||
public static TextureAtlasSprite armour_legs;
|
||||
public static TextureAtlasSprite armour_feet;
|
||||
|
||||
@SubscribeEvent
|
||||
public void preTextureStitch(TextureStitchEvent.Pre event) {
|
||||
TextureMap map = event.getMap();
|
||||
armour_head = map.registerSprite(new ResourceLocation("techreborn:gui/slot_sprites/armour_head"));
|
||||
|
||||
|
||||
armour_chest = map.registerSprite(new ResourceLocation("techreborn:gui/slot_sprites/armour_chest"));
|
||||
armour_legs = map.registerSprite(new ResourceLocation("techreborn:gui/slot_sprites/armour_legs"));
|
||||
armour_feet = map.registerSprite(new ResourceLocation("techreborn:gui/slot_sprites/armour_feet"));
|
||||
}
|
||||
|
||||
// public static IIcon insulatedCopperCable;
|
||||
// public static IIcon copperCable;
|
||||
// public static IIcon goldCable;
|
||||
// public static IIcon insulatedGoldCable;
|
||||
// public static IIcon doubleInsulatedGoldCable;
|
||||
// public static IIcon ironCable;
|
||||
// public static IIcon insulatedIronCable;
|
||||
// public static IIcon doubleInsulatedIronCable;
|
||||
// public static IIcon trippleInsulatedIronCable;
|
||||
// public static IIcon glassFiberCable;
|
||||
// public static IIcon tinCable;
|
||||
// public static IIcon detectorCableBlock;
|
||||
// public static IIcon splitterCableBlock;
|
||||
// public static IIcon insulatedtinCableBlock;
|
||||
|
||||
// @SubscribeEvent
|
||||
// public void onTextureStitch(TextureStitchEvent.Pre event) {
|
||||
// TextureMap reg = event.map;
|
||||
// if (reg.getTextureType() == 0) {
|
||||
// insulatedCopperCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockCable");
|
||||
// copperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCableO");
|
||||
// goldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCable");
|
||||
// insulatedGoldCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockGoldCableI");
|
||||
// doubleInsulatedGoldCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockGoldCableII");
|
||||
// ironCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCable");
|
||||
// insulatedIronCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockIronCableI");
|
||||
// doubleInsulatedIronCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockIronCableII");
|
||||
// trippleInsulatedIronCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockIronCableIII");
|
||||
// glassFiberCable = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockGlassCable");
|
||||
// tinCable = reg.registerIcon("ic2" + ":wiring/cable/blockTinCable");
|
||||
// detectorCableBlock = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockDetectorCable");
|
||||
// splitterCableBlock = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockSplitterCable");
|
||||
// insulatedtinCableBlock = reg.registerIcon("ic2" +
|
||||
// ":wiring/cable/blockTinCableI");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -24,11 +24,12 @@
|
|||
|
||||
package techreborn.client.container.builder;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import org.apache.commons.lang3.Range;
|
||||
import reborncore.client.gui.slots.BaseSlot;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.client.IconSupplier;
|
||||
import techreborn.client.container.builder.slot.SpriteSlot;
|
||||
|
||||
public final class ContainerPlayerInventoryBuilder {
|
||||
|
@ -94,30 +95,26 @@ public final class ContainerPlayerInventoryBuilder {
|
|||
}
|
||||
|
||||
private ContainerPlayerArmorInventoryBuilder armor(final int index, final int xStart, final int yStart,
|
||||
final EntityEquipmentSlot slotType) {
|
||||
|
||||
// this.parent.parent.slots.add(new FilteredSlot(this.parent.player, index, xStart, yStart)
|
||||
// .setFilter(stack -> stack.getItem().isValidArmor(stack, slotType, this.parent.player.player)));
|
||||
String sprite = "armour_" + slotType.getName();
|
||||
final EntityEquipmentSlot slotType, final TextureAtlasSprite sprite) {
|
||||
this.parent.parent.slots.add(new SpriteSlot(this.parent.player, index, xStart, yStart, sprite, 1)
|
||||
.setFilter(stack -> stack.getItem().isValidArmor(stack, slotType, this.parent.player.player)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public ContainerPlayerArmorInventoryBuilder helmet(final int xStart, final int yStart) {
|
||||
return this.armor(this.parent.player.getSizeInventory() - 2, xStart, yStart, EntityEquipmentSlot.HEAD);
|
||||
return this.armor(this.parent.player.getSizeInventory() - 2, xStart, yStart, EntityEquipmentSlot.HEAD, IconSupplier.armour_head);
|
||||
}
|
||||
|
||||
public ContainerPlayerArmorInventoryBuilder chestplate(final int xStart, final int yStart) {
|
||||
return this.armor(this.parent.player.getSizeInventory() - 3, xStart, yStart, EntityEquipmentSlot.CHEST);
|
||||
return this.armor(this.parent.player.getSizeInventory() - 3, xStart, yStart, EntityEquipmentSlot.CHEST, IconSupplier.armour_chest);
|
||||
}
|
||||
|
||||
public ContainerPlayerArmorInventoryBuilder leggings(final int xStart, final int yStart) {
|
||||
return this.armor(this.parent.player.getSizeInventory() - 4, xStart, yStart, EntityEquipmentSlot.LEGS);
|
||||
return this.armor(this.parent.player.getSizeInventory() - 4, xStart, yStart, EntityEquipmentSlot.LEGS, IconSupplier.armour_legs);
|
||||
}
|
||||
|
||||
public ContainerPlayerArmorInventoryBuilder boots(final int xStart, final int yStart) {
|
||||
return this.armor(this.parent.player.getSizeInventory() - 5, xStart, yStart, EntityEquipmentSlot.FEET);
|
||||
return this.armor(this.parent.player.getSizeInventory() - 5, xStart, yStart, EntityEquipmentSlot.FEET, IconSupplier.armour_feet);
|
||||
}
|
||||
|
||||
public ContainerPlayerArmorInventoryBuilder complete(final int xStart, final int yStart) {
|
||||
|
|
|
@ -28,23 +28,20 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.client.IconSupplier;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class SpriteSlot extends FilteredSlot {
|
||||
|
||||
private final String sprite;
|
||||
private final String spriteName;
|
||||
int stacksize;
|
||||
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite, final int stacksize) {
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final TextureAtlasSprite sprite, final int stacksize) {
|
||||
super(inventory, index, xPosition, yPosition);
|
||||
this.sprite = ModInfo.MOD_ID + ":textures/gui/slot_sprites/" + sprite + ".png";
|
||||
this.spriteName = sprite.getIconName();
|
||||
this.stacksize = stacksize;
|
||||
}
|
||||
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite) {
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final TextureAtlasSprite sprite) {
|
||||
this(inventory, index, xPosition, yPosition, sprite, 64);
|
||||
}
|
||||
|
||||
|
@ -57,6 +54,6 @@ public class SpriteSlot extends FilteredSlot {
|
|||
@Nullable
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getSlotTexture() {
|
||||
return this.sprite;
|
||||
return this.spriteName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,9 +93,9 @@ public class ClientProxy extends CommonProxy {
|
|||
ShootingStar.registerModels(ModInfo.MOD_ID);
|
||||
StackInfoHUD.registerElement(new ItemFrequencyTransmitter.StackInfoFreqTransmitter());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNukePrimed.class, new RenderManagerNuke());
|
||||
|
||||
ModelDynamicCell.init();
|
||||
RegisterItemJsons.registerModels();
|
||||
MinecraftForge.EVENT_BUS.register(new IconSupplier());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,8 +107,6 @@ public class ClientProxy extends CommonProxy {
|
|||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
MinecraftForge.EVENT_BUS.register(new IconSupplier());
|
||||
//MinecraftForge.EVENT_BUS.register(new VersionCheckerClient());
|
||||
MinecraftForge.EVENT_BUS.register(new StackToolTipEvent());
|
||||
multiblockRenderEvent = new MultiblockRenderEvent();
|
||||
MinecraftForge.EVENT_BUS.register(multiblockRenderEvent);
|
||||
|
|
Loading…
Add table
Reference in a new issue