use of net.minecraft.util.NonNullList in project Random-Things by lumien231.
the class DescriptionHandler method addDescriptions.
public static void addDescriptions(IModRegistry registry) {
DescriptionHandler.registry = registry;
Map<Object, String> overrideMap = new HashMap<>();
overrideMap.put(ModBlocks.customWorkbench, "tile.customWorkbench.info");
overrideMap.put(ModBlocks.specialChest, null);
overrideMap.put(ModItems.rezStone, null);
overrideMap.put(ModBlocks.platform, "tile.platform.info");
overrideMap.put(ModBlocks.contactLever, "tile.contactButton.info");
overrideMap.put(ModBlocks.luminousBlock, "tile.luminousBlock.info");
overrideMap.put(ModBlocks.translucentLuminousBlock, "tile.translucentLuminousBlock.info");
overrideMap.put(ModBlocks.biomeStone, "tile.biomeStone.info");
overrideMap.put(ModBlocks.coloredGrass, "tile.coloredGrass.info");
overrideMap.put(ModBlocks.stainedBrick, "tile.stainedBrick.info");
overrideMap.put(ModBlocks.luminousStainedBrick, "tile.luminousStainedBrick.info");
overrideMap.put(ModItems.grassSeeds, "item.grassSeeds.info");
overrideMap.put(ModItems.runeDust, "item.runeDust.info");
List<ItemStack> stackBlackList = new ArrayList<>();
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.BIOME_SENSOR.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.EVIL_TEAR.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.SPECTRE_INGOT.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.SUPERLUBRICENT_TINCTURE.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.FLOO_POWDER.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.PLATE_BASE.id));
stackBlackList.add(new ItemStack(ModItems.ingredients, 1, ItemIngredient.INGREDIENT.PRECIOUS_EMERALD.id));
removeDes(overrideMap, ModBlocks.spectreLeaf, ModBlocks.natureCore, ModBlocks.spectreLog, ModBlocks.spectrePlank, ModBlocks.specialChest, ModBlocks.superLubricentPlatform, ModBlocks.filteredSuperLubricentPlatform);
Stream.concat(BlockBase.rtBlockList.stream(), ItemBase.rtItemList.stream()).forEach(new Consumer<Object>() {
@Override
public void accept(Object t) {
NonNullList<ItemStack> subItems = NonNullList.create();
if (t instanceof Item) {
Item item = (Item) t;
if (item.getCreativeTab() == RandomThings.instance.creativeTab) {
item.getSubItems(RandomThings.instance.creativeTab, subItems);
}
} else if (t instanceof Block) {
Block block = (Block) t;
if (block.getCreativeTabToDisplayOn() == RandomThings.instance.creativeTab) {
block.getSubBlocks(RandomThings.instance.creativeTab, subItems);
}
}
if (!subItems.isEmpty()) {
if (overrideMap.containsKey(t)) {
String override = overrideMap.get(t);
if (override != null) {
if (t instanceof Block) {
registry.addDescription(new ItemStack((Block) t, 1, OreDictionary.WILDCARD_VALUE), override);
} else if (t instanceof Item) {
registry.addDescription(new ItemStack((Item) t, 1, OreDictionary.WILDCARD_VALUE), override);
}
}
return;
}
}
for (ItemStack is : subItems) {
if (!is.isEmpty()) {
boolean blackListed = false;
for (ItemStack b : stackBlackList) {
if (ItemStack.areItemStacksEqual(b, is)) {
blackListed = true;
break;
}
}
if (!blackListed) {
registry.addDescription(is, is.getUnlocalizedName() + ".info");
}
}
}
}
});
}
use of net.minecraft.util.NonNullList in project ImmersiveEngineering by BluSunrize.
the class ClientEventHandler method onRenderOverlayPost.
@SubscribeEvent()
public void onRenderOverlayPost(RenderGameOverlayEvent.Post event) {
if (ClientUtils.mc().player != null && event.getType() == RenderGameOverlayEvent.ElementType.TEXT) {
EntityPlayer player = ClientUtils.mc().player;
for (EnumHand hand : EnumHand.values()) if (!player.getHeldItem(hand).isEmpty()) {
ItemStack equipped = player.getHeldItem(hand);
if (OreDictionary.itemMatches(new ItemStack(IEContent.itemTool, 1, 2), equipped, false) || equipped.getItem() instanceof IWireCoil) {
if (ItemNBTHelper.hasKey(equipped, "linkingPos")) {
int[] link = ItemNBTHelper.getIntArray(equipped, "linkingPos");
if (link != null && link.length > 3) {
String s = I18n.format(Lib.DESC_INFO + "attachedTo", link[1], link[2], link[3]);
int col = WireType.ELECTRUM.getColour(null);
if (equipped.getItem() instanceof IWireCoil) {
RayTraceResult rtr = ClientUtils.mc().objectMouseOver;
double d = rtr != null && rtr.getBlockPos() != null ? rtr.getBlockPos().distanceSq(link[1], link[2], link[3]) : player.getDistanceSq(link[1], link[2], link[3]);
int max = ((IWireCoil) equipped.getItem()).getWireType(equipped).getMaxLength();
if (d > max * max)
col = 0xdd3333;
}
ClientUtils.font().drawString(s, event.getResolution().getScaledWidth() / 2 - ClientUtils.font().getStringWidth(s) / 2, event.getResolution().getScaledHeight() - GuiIngameForge.left_height - 20, col, true);
}
}
} else if (OreDictionary.itemMatches(equipped, new ItemStack(IEContent.itemFluorescentTube), false)) {
String s = I18n.format("desc.immersiveengineering.info.colour", "#" + ItemFluorescentTube.hexColorString(equipped));
ClientUtils.font().drawString(s, event.getResolution().getScaledWidth() / 2 - ClientUtils.font().getStringWidth(s) / 2, event.getResolution().getScaledHeight() - GuiIngameForge.left_height - 20, ItemFluorescentTube.getRGBInt(equipped, 1), true);
} else if (equipped.getItem() instanceof ItemRevolver || equipped.getItem() instanceof ItemSpeedloader) {
NonNullList<ItemStack> bullets = ((IBulletContainer) equipped.getItem()).getBullets(equipped, true);
if (bullets != null) {
int bulletAmount = ((IBulletContainer) equipped.getItem()).getBulletCount(equipped);
EnumHandSide side = hand == EnumHand.MAIN_HAND ? player.getPrimaryHand() : player.getPrimaryHand().opposite();
boolean right = side == EnumHandSide.RIGHT;
float dx = right ? event.getResolution().getScaledWidth() - 32 - 48 : 48;
float dy = event.getResolution().getScaledHeight() - 64;
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.enableBlend();
GlStateManager.translate(dx, dy, 0);
GlStateManager.scale(.5f, .5f, 1);
GuiRevolver.drawExternalGUI(bullets, bulletAmount);
if (equipped.getItem() instanceof ItemRevolver) {
int cd = ((ItemRevolver) equipped.getItem()).getShootCooldown(equipped);
float cdMax = ((ItemRevolver) equipped.getItem()).getMaxShootCooldown(equipped);
float cooldown = 1 - cd / cdMax;
if (cooldown > 0) {
GlStateManager.scale(2, 2, 1);
GlStateManager.translate(-dx, -dy, 0);
GlStateManager.translate(event.getResolution().getScaledWidth() / 2 + (right ? 1 : -6), event.getResolution().getScaledHeight() / 2 - 7, 0);
float h1 = cooldown > .33 ? .5f : cooldown * 1.5f;
float h2 = cooldown;
float x2 = cooldown < .75 ? 1 : 4 * (1 - cooldown);
float uMin = (88 + (right ? 0 : 7 * x2)) / 256f;
float uMax = (88 + (right ? 7 * x2 : 0)) / 256f;
float vMin1 = (112 + (right ? h1 : h2) * 15) / 256f;
float vMin2 = (112 + (right ? h2 : h1) * 15) / 256f;
ClientUtils.bindTexture("immersiveengineering:textures/gui/hud_elements.png");
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder worldrenderer = tessellator.getBuffer();
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((right ? 0 : 1 - x2) * 7, 15, 0).tex(uMin, 127 / 256f).endVertex();
worldrenderer.pos((right ? x2 : 1) * 7, 15, 0).tex(uMax, 127 / 256f).endVertex();
worldrenderer.pos((right ? x2 : 1) * 7, (right ? h2 : h1) * 15, 0).tex(uMax, vMin2).endVertex();
worldrenderer.pos((right ? 0 : 1 - x2) * 7, (right ? h1 : h2) * 15, 0).tex(uMin, vMin1).endVertex();
tessellator.draw();
}
}
RenderHelper.disableStandardItemLighting();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
} else if (equipped.getItem() instanceof ItemRailgun) {
int duration = 72000 - (player.isHandActive() && player.getActiveHand() == hand ? player.getItemInUseCount() : 0);
int chargeTime = ((ItemRailgun) equipped.getItem()).getChargeTime(equipped);
int chargeLevel = duration < 72000 ? Math.min(99, (int) (duration / (float) chargeTime * 100)) : 0;
float scale = 2f;
GlStateManager.pushMatrix();
GlStateManager.translate(event.getResolution().getScaledWidth() - 80, event.getResolution().getScaledHeight() - 30, 0);
GlStateManager.scale(scale, scale, 1);
ClientProxy.nixieFont.drawString((chargeLevel < 10 ? "0" : "") + chargeLevel, 0, 0, Lib.colour_nixieTubeText, false);
GlStateManager.scale(1 / scale, 1 / scale, 1);
GlStateManager.popMatrix();
} else if ((equipped.getItem() instanceof ItemDrill && equipped.getItemDamage() == 0) || equipped.getItem() instanceof ItemChemthrower) {
boolean drill = equipped.getItem() instanceof ItemDrill;
ClientUtils.bindTexture("immersiveengineering:textures/gui/hud_elements.png");
GlStateManager.color(1, 1, 1, 1);
float dx = event.getResolution().getScaledWidth() - 16;
float dy = event.getResolution().getScaledHeight();
GlStateManager.pushMatrix();
GlStateManager.translate(dx, dy, 0);
int w = 31;
int h = 62;
double uMin = 179 / 256f;
double uMax = 210 / 256f;
double vMin = 9 / 256f;
double vMax = 71 / 256f;
ClientUtils.drawTexturedRect(-24, -68, w, h, uMin, uMax, vMin, vMax);
GlStateManager.translate(-23, -37, 0);
IFluidHandler handler = FluidUtil.getFluidHandler(equipped);
int capacity = -1;
if (handler != null) {
IFluidTankProperties[] props = handler.getTankProperties();
if (props != null && props.length > 0)
capacity = props[0].getCapacity();
}
if (capacity > -1) {
FluidStack fuel = FluidUtil.getFluidContained(equipped);
int amount = fuel != null ? fuel.amount : 0;
if (!drill && player.isHandActive() && player.getActiveHand() == hand) {
int use = player.getItemInUseMaxCount();
amount -= use * IEConfig.Tools.chemthrower_consumption;
}
float cap = (float) capacity;
float angle = 83 - (166 * amount / cap);
GlStateManager.rotate(angle, 0, 0, 1);
ClientUtils.drawTexturedRect(6, -2, 24, 4, 91 / 256f, 123 / 256f, 80 / 256f, 87 / 256f);
GlStateManager.rotate(-angle, 0, 0, 1);
// for(int i=0; i<=8; i++)
// {
// float angle = 83-(166/8f)*i;
// GL11.glRotatef(angle, 0, 0, 1);
// ClientUtils.drawTexturedRect(6,-2, 24,4, 91/256f,123/256f, 80/96f,87/96f);
// GL11.glRotatef(-angle, 0, 0, 1);
// }
GlStateManager.translate(23, 37, 0);
if (drill) {
ClientUtils.drawTexturedRect(-54, -73, 66, 72, 108 / 256f, 174 / 256f, 4 / 256f, 76 / 256f);
RenderItem ir = ClientUtils.mc().getRenderItem();
ItemStack head = ((ItemDrill) equipped.getItem()).getHead(equipped);
if (!head.isEmpty()) {
ir.renderItemIntoGUI(head, -51, -45);
ir.renderItemOverlayIntoGUI(head.getItem().getFontRenderer(head), head, -51, -45, null);
RenderHelper.disableStandardItemLighting();
}
} else {
ClientUtils.drawTexturedRect(-41, -73, 53, 72, 8 / 256f, 61 / 256f, 4 / 256f, 76 / 256f);
boolean ignite = ItemNBTHelper.getBoolean(equipped, "ignite");
ClientUtils.drawTexturedRect(-32, -43, 12, 12, 66 / 256f, 78 / 256f, (ignite ? 21 : 9) / 256f, (ignite ? 33 : 21) / 256f);
ClientUtils.drawTexturedRect(-100, -20, 64, 16, 0 / 256f, 64 / 256f, 76 / 256f, 92 / 256f);
if (fuel != null) {
String name = ClientUtils.font().trimStringToWidth(fuel.getLocalizedName(), 50).trim();
ClientUtils.font().drawString(name, -68 - ClientUtils.font().getStringWidth(name) / 2, -15, 0);
}
}
}
GlStateManager.popMatrix();
} else if (equipped.getItem() instanceof ItemIEShield) {
NBTTagCompound upgrades = ((ItemIEShield) equipped.getItem()).getUpgrades(equipped);
if (!upgrades.isEmpty()) {
ClientUtils.bindTexture("immersiveengineering:textures/gui/hud_elements.png");
GlStateManager.color(1, 1, 1, 1);
boolean boundLeft = (player.getPrimaryHand() == EnumHandSide.RIGHT) == (hand == EnumHand.OFF_HAND);
float dx = boundLeft ? 16 : (event.getResolution().getScaledWidth() - 16 - 64);
float dy = event.getResolution().getScaledHeight();
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.translate(dx, dy, 0);
ClientUtils.drawTexturedRect(0, -22, 64, 22, 0, 64 / 256f, 176 / 256f, 198 / 256f);
if (upgrades.getBoolean("flash")) {
ClientUtils.drawTexturedRect(11, -38, 16, 16, 11 / 256f, 27 / 256f, 160 / 256f, 176 / 256f);
if (upgrades.hasKey("flash_cooldown")) {
float h = upgrades.getInteger("flash_cooldown") / 40f * 16;
ClientUtils.drawTexturedRect(11, -22 - h, 16, h, 11 / 256f, 27 / 256f, (214 - h) / 256f, 214 / 256f);
}
}
if (upgrades.getBoolean("shock")) {
ClientUtils.drawTexturedRect(40, -38, 12, 16, 40 / 256f, 52 / 256f, 160 / 256f, 176 / 256f);
if (upgrades.hasKey("shock_cooldown")) {
float h = upgrades.getInteger("shock_cooldown") / 40f * 16;
ClientUtils.drawTexturedRect(40, -22 - h, 12, h, 40 / 256f, 52 / 256f, (214 - h) / 256f, 214 / 256f);
}
}
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}
}
// else if(equipped.getItem() instanceof ItemRailgun)
// {
// float dx = event.getResolution().getScaledWidth()-32-48;
// float dy = event.getResolution().getScaledHeight()-40;
// ClientUtils.bindTexture("immersiveengineering:textures/gui/hud_elements.png");
// GlStateManager.color(1, 1, 1, 1);
// GlStateManager.pushMatrix();
// GL11.glEnable(GL11.GL_BLEND);
// GlStateManager.translate(dx, dy, 0);
//
// int duration = player.getItemInUseDuration();
// int chargeTime = ((ItemRailgun)equipped.getItem()).getChargeTime(equipped);
// int chargeLevel = Math.min(99, (int)(duration/(float)chargeTime*100));
// // ClientUtils.drawTexturedRect(0,0, 64,32, 0/256f,64/256f, 96/256f,128/256f);
//
// GlStateManager.scale(1.5f,1.5f,1.5f);
// int col = Config.getBoolean("nixietubeFont")?Lib.colour_nixieTubeText:0xffffff;
// ClientProxy.nixieFont.setDrawTubeFlag(false);
// // ClientProxy.nixieFont.drawString((chargeLevel<10?"0"+chargeLevel:""+chargeLevel), 19,3, col);
// ClientProxy.nixieFont.setDrawTubeFlag(true);
//
// GlStateManager.popMatrix();
// }
RayTraceResult mop = ClientUtils.mc().objectMouseOver;
if (mop != null && mop.getBlockPos() != null) {
TileEntity tileEntity = player.world.getTileEntity(mop.getBlockPos());
if (OreDictionary.itemMatches(new ItemStack(IEContent.itemTool, 1, 2), equipped, true)) {
int col = IEConfig.nixietubeFont ? Lib.colour_nixieTubeText : 0xffffff;
String[] text = null;
if (tileEntity instanceof IFluxReceiver) {
int maxStorage = ((IFluxReceiver) tileEntity).getMaxEnergyStored(mop.sideHit);
int storage = ((IFluxReceiver) tileEntity).getEnergyStored(mop.sideHit);
if (maxStorage > 0)
text = I18n.format(Lib.DESC_INFO + "energyStored", "<br>" + Utils.toScientificNotation(storage, "0##", 100000) + " / " + Utils.toScientificNotation(maxStorage, "0##", 100000)).split("<br>");
} else // }
if (mop.entityHit instanceof IFluxReceiver) {
int maxStorage = ((IFluxReceiver) mop.entityHit).getMaxEnergyStored(null);
int storage = ((IFluxReceiver) mop.entityHit).getEnergyStored(null);
if (maxStorage > 0)
text = I18n.format(Lib.DESC_INFO + "energyStored", "<br>" + Utils.toScientificNotation(storage, "0##", 100000) + " / " + Utils.toScientificNotation(maxStorage, "0##", 100000)).split("<br>");
}
if (text != null) {
if (player.world.getTotalWorldTime() % 20 == 0) {
ImmersiveEngineering.packetHandler.sendToServer(new MessageRequestBlockUpdate(mop.getBlockPos()));
}
int i = 0;
for (String s : text) if (s != null) {
int w = ClientProxy.nixieFontOptional.getStringWidth(s);
ClientProxy.nixieFontOptional.drawString(s, event.getResolution().getScaledWidth() / 2 - w / 2, event.getResolution().getScaledHeight() / 2 - 4 - text.length * (ClientProxy.nixieFontOptional.FONT_HEIGHT + 2) + (i++) * (ClientProxy.nixieFontOptional.FONT_HEIGHT + 2), col, true);
}
}
}
}
}
if (ClientUtils.mc().objectMouseOver != null) {
boolean hammer = !player.getHeldItem(EnumHand.MAIN_HAND).isEmpty() && Utils.isHammer(player.getHeldItem(EnumHand.MAIN_HAND));
RayTraceResult mop = ClientUtils.mc().objectMouseOver;
if (mop != null && mop.getBlockPos() != null) {
TileEntity tileEntity = player.world.getTileEntity(mop.getBlockPos());
if (tileEntity instanceof IBlockOverlayText) {
IBlockOverlayText overlayBlock = (IBlockOverlayText) tileEntity;
String[] text = overlayBlock.getOverlayText(ClientUtils.mc().player, mop, hammer);
boolean useNixie = overlayBlock.useNixieFont(ClientUtils.mc().player, mop);
if (text != null && text.length > 0) {
FontRenderer font = useNixie ? ClientProxy.nixieFontOptional : ClientUtils.font();
int col = (useNixie && IEConfig.nixietubeFont) ? Lib.colour_nixieTubeText : 0xffffff;
int i = 0;
for (String s : text) if (s != null)
font.drawString(s, event.getResolution().getScaledWidth() / 2 + 8, event.getResolution().getScaledHeight() / 2 + 8 + (i++) * font.FONT_HEIGHT, col, true);
}
}
}
}
}
}
use of net.minecraft.util.NonNullList in project ImmersiveEngineering by BluSunrize.
the class IngredientMultiOre method getValidItemStacksPacked.
@Override
@Nonnull
@SideOnly(Side.CLIENT)
public IntList getValidItemStacksPacked() {
if (this.itemIds == null || this.itemIds.size() != totalSize()) {
this.itemIds = new IntArrayList(totalSize());
for (NonNullList<ItemStack> list : ores) for (ItemStack stack : list) {
if (stack.getMetadata() == OreDictionary.WILDCARD_VALUE) {
NonNullList<ItemStack> lst = NonNullList.create();
stack.getItem().getSubItems(CreativeTabs.SEARCH, lst);
for (ItemStack item : lst) this.itemIds.add(RecipeItemHelper.pack(item));
} else {
this.itemIds.add(RecipeItemHelper.pack(stack));
}
}
this.itemIds.sort(IntComparators.NATURAL_COMPARATOR);
}
return this.itemIds;
}
use of net.minecraft.util.NonNullList in project BluePower by Qmunity.
the class JEIPlugin method getMicroblockRecipes.
private static List<IRecipe<?>> getMicroblockRecipes() {
List<IRecipe<?>> recipes = new ArrayList<>();
for (Block block : ForgeRegistries.BLOCKS.getValues().stream().filter(b -> !b.hasTileEntity(b.defaultBlockState())).collect(Collectors.toList())) {
VoxelShape shape = null;
try {
shape = block.defaultBlockState().getShape(null, null);
} catch (NullPointerException ignored) {
// Shulker Boxes try to query the Tile Entity
}
if (block.getRegistryName() != null && shape == VoxelShapes.block()) {
ItemStack output = ItemStack.EMPTY;
for (Block mb : BPBlocks.microblocks) {
NonNullList<Ingredient> input = NonNullList.create();
input.add(Ingredient.of(ItemTags.createOptional(new ResourceLocation("bluepower:saw"))));
if (mb == BPBlocks.half_block) {
input.add(Ingredient.of(new ItemStack(block)));
} else {
input.add(Ingredient.of(output));
}
CompoundNBT nbt = new CompoundNBT();
nbt.putString("block", block.getRegistryName().toString());
ItemStack stack = new ItemStack(mb);
stack.setTag(nbt);
stack.setHoverName(new TranslationTextComponent(block.getDescriptionId()).append(new StringTextComponent(" ")).append(new TranslationTextComponent(mb.getDescriptionId())));
output = stack;
recipes.add(new ShapelessRecipe(new ResourceLocation("bluepower:" + mb.getDescriptionId() + block.getDescriptionId()), "", output, input));
}
}
}
return recipes;
}
use of net.minecraft.util.NonNullList in project LogisticsPipes by RS485.
the class ProxyManager method load.
public static void load() {
// @formatter:off
// CHECKSTYLE:OFF
SimpleServiceLocator.setBuildCraftProxy(ProxyManager.getWrappedProxy(LPConstants.bcTransportModID + "+" + LPConstants.bcSiliconModID, IBCProxy.class, BuildCraftProxy.class, new IBCProxy() {
@Override
public void registerPipeInformationProvider() {
}
@Override
public void initProxy() {
}
@Override
public boolean isActive() {
return false;
}
@Override
public boolean isInstalled() {
return false;
}
@Override
public CraftingParts getRecipeParts() {
return null;
}
@Override
public void addCraftingRecipes(CraftingParts parts) {
}
@Override
public Class<? extends ICraftingRecipeProvider> getAssemblyTableProviderClass() {
return null;
}
@Override
public void registerInventoryHandler() {
}
@Override
public IBCPipeCapabilityProvider getIBCPipeCapabilityProvider(LogisticsTileGenericPipe pipe) {
return new IBCPipeCapabilityProvider() {
@Override
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing) {
return false;
}
@Nullable
@Override
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
return null;
}
};
}
@Override
public Object createMjReceiver(@Nonnull LogisticsPowerJunctionTileEntity te) {
return null;
}
@Override
public boolean isBuildCraftPipe(TileEntity tile) {
return false;
}
}, IBCPipeCapabilityProvider.class));
SimpleServiceLocator.setElectricItemProxy(ProxyManager.getWrappedProxy(LPConstants.ic2ModID, IIC2Proxy.class, IC2Proxy.class, new IIC2Proxy() {
@Override
public void addCraftingRecipes(CraftingParts parts) {
}
@Override
public boolean hasIC2() {
return false;
}
@Override
public void registerToEneryNet(TileEntity tile) {
}
@Override
public void unregisterToEneryNet(TileEntity tile) {
}
@Override
public boolean acceptsEnergyFrom(TileEntity tile1, TileEntity tile2, EnumFacing opposite) {
return false;
}
@Override
public boolean isEnergySink(TileEntity tile) {
return false;
}
@Override
public double demandedEnergyUnits(TileEntity tile) {
return 0;
}
@Override
public double injectEnergyUnits(TileEntity tile, EnumFacing opposite, double d) {
return d;
}
}));
SimpleServiceLocator.setCCProxy(ProxyManager.getWrappedProxy(LPConstants.computerCraftModID, ICCProxy.class, CCProxy.class, new ICCProxy() {
@Override
public boolean isTurtle(TileEntity tile) {
return false;
}
@Override
public boolean isComputer(TileEntity tile) {
return false;
}
@Override
public boolean isCC() {
return false;
}
@Override
public boolean isLuaThread(Thread thread) {
return false;
}
@Override
public void queueEvent(String event, Object[] arguments, LogisticsTileGenericPipe logisticsTileGenericPipe) {
}
@Override
public void setTurtleConnect(boolean flag, LogisticsTileGenericPipe logisticsTileGenericPipe) {
}
@Override
public boolean getTurtleConnect(LogisticsTileGenericPipe logisticsTileGenericPipe) {
return false;
}
@Override
public int getLastCCID(LogisticsTileGenericPipe logisticsTileGenericPipe) {
return 0;
}
@Override
public void handleMesssage(int computerId, Object message, LogisticsTileGenericPipe tile, int sourceId) {
}
@Override
public void addCraftingRecipes(CraftingParts parts) {
}
@Override
public Object getAnswer(Object object) {
return object;
}
}));
SimpleServiceLocator.setThermalExpansionProxy(ProxyManager.getWrappedProxy(LPConstants.thermalExpansionModID, IThermalExpansionProxy.class, ThermalExpansionProxy.class, new IThermalExpansionProxy() {
@Override
public boolean isTE() {
return false;
}
@Override
public CraftingParts getRecipeParts() {
return null;
}
@Override
public boolean isToolHammer(Item stack) {
return false;
}
@Override
public boolean canHammer(@Nonnull ItemStack stack, EntityPlayer entityplayer, BlockPos pos) {
return false;
}
@Override
public void toolUsed(@Nonnull ItemStack stack, EntityPlayer entityplayer, BlockPos pos) {
}
}));
SimpleServiceLocator.setBetterStorageProxy(ProxyManager.getWrappedProxy(LPConstants.betterStorageModID, IBetterStorageProxy.class, BetterStorageProxy.class, new IBetterStorageProxy() {
@Override
public boolean isBetterStorageCrate(TileEntity tile) {
return false;
}
@Override
public ICrateStorageProxy getCrateStorageProxy(TileEntity tile) {
return new ICrateStorageProxy() {
@Override
public Iterable<ItemStack> getContents() {
return null;
}
@Override
public int getUniqueItems() {
return 0;
}
@Override
public int getItemCount(@Nonnull ItemStack stack) {
return 0;
}
@Override
@Nonnull
public ItemStack extractItems(@Nonnull ItemStack stack, int count) {
return null;
}
@Override
public int getSpaceForItem(@Nonnull ItemStack stack) {
return 0;
}
@Override
@Nonnull
public ItemStack insertItems(@Nonnull ItemStack stack) {
return stack;
}
};
}
}, ICrateStorageProxy.class));
SimpleServiceLocator.setNEIProxy(ProxyManager.getWrappedProxy(LPConstants.neiModID, INEIProxy.class, null, /*NEIProxy.class*/
new INEIProxy() {
@Override
public List<String> getInfoForPosition(World world, EntityPlayer player, RayTraceResult objectMouseOver) {
return new ArrayList<>(0);
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderItemToolTip(int posX, int posY, List<String> msg, TextFormatting rarityColor, @Nonnull ItemStack stack) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public List<String> getItemToolTip(@Nonnull ItemStack stack, EntityPlayer thePlayer, ITooltipFlag advancedItemTooltips, GuiContainer screen) {
return stack.getTooltip(thePlayer, advancedItemTooltips);
}
@Override
@Nonnull
public ItemStack getItemForPosition(World world, EntityPlayer player, RayTraceResult objectMouseOver) {
return null;
}
}));
SimpleServiceLocator.setFactorizationProxy(ProxyManager.getWrappedProxy(LPConstants.factorizationModID, IFactorizationProxy.class, FactorizationProxy.class, tile -> false));
SimpleServiceLocator.setEnderIOProxy(ProxyManager.getWrappedProxy(LPConstants.enderioModID, IEnderIOProxy.class, null, /*EnderIOProxy.class*/
new IEnderIOProxy() {
@Override
public boolean isSendAndReceive(TileEntity tile) {
return false;
}
@Override
public boolean isTransceiver(TileEntity tile) {
return false;
}
@Override
public List<TileEntity> getConnectedTransceivers(TileEntity tile) {
return null;
}
@Override
public boolean isEnderIO() {
return false;
}
@Override
public boolean isItemConduit(TileEntity tile, EnumFacing dir) {
return false;
}
@Override
public boolean isFluidConduit(TileEntity tile, EnumFacing dir) {
return false;
}
@Override
public boolean isBundledPipe(TileEntity tile) {
return false;
}
}));
SimpleServiceLocator.setIronChestProxy(ProxyManager.getWrappedProxy(LPConstants.ironChestModID, IIronChestProxy.class, IronChestProxy.class, new IIronChestProxy() {
@Override
public boolean isIronChest(TileEntity tile) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean isChestGui(GuiScreen gui) {
return false;
}
}));
SimpleServiceLocator.setEnderStorageProxy(ProxyManager.getWrappedProxy("enderstorage", IEnderStorageProxy.class, EnderStorageProxy.class, new IEnderStorageProxy() {
@Override
public boolean isEnderChestBlock(Block block) {
return false;
}
@Override
public void openEnderChest(World world, int x, int y, int z, EntityPlayer player) {
}
}));
SimpleServiceLocator.setOpenComputersProxy(ProxyManager.getWrappedProxy(LPConstants.openComputersModID, IOpenComputersProxy.class, OpenComputersProxy.class, new IOpenComputersProxy() {
@Override
public void initLogisticsTileGenericPipe(LogisticsTileGenericPipe tile) {
}
@Override
public void initLogisticsSolidTileEntity(LogisticsSolidTileEntity tile) {
}
@Override
public void handleWriteToNBT(IOCTile tile, NBTTagCompound nbt) {
}
@Override
public void handleReadFromNBT(IOCTile tile, NBTTagCompound nbt) {
}
@Override
public void handleInvalidate(IOCTile tile) {
}
@Override
public void handleChunkUnload(IOCTile tile) {
}
@Override
public void addToNetwork(TileEntity tile) {
}
}));
/* SimpleServiceLocator.setToolWrenchProxy(ProxyManager.getWrappedProxy("!IToolWrench", IToolWrenchProxy.class, ToolWrenchProxy.class, new IToolWrenchProxy() {
@Override public void wrenchUsed(EntityPlayer entityplayer, int x, int y, int z) {}
@Override public boolean isWrenchEquipped(EntityPlayer entityplayer) {return false;}
@Override public boolean canWrench(EntityPlayer entityplayer, int x, int y, int z) {return false;}
@Override public boolean isWrench(Item item) {return false;}
}));*/
SimpleServiceLocator.setThermalDynamicsProxy(ProxyManager.getWrappedProxy(LPConstants.thermalDynamicsModID, ITDProxy.class, ThermalDynamicsProxy.class, new ITDProxy() {
@Override
public ITDPart getTDPart(final LogisticsTileGenericPipe pipe) {
return new ITDPart() {
@Override
public TileEntity getInternalDuct() {
return pipe;
}
@Override
public void setWorld_LP(World world) {
}
@Override
public void invalidate() {
}
@Override
public void onChunkUnload() {
}
@Override
public void scheduleNeighborChange() {
}
@Override
public void connectionsChanged() {
}
@Override
public boolean isLPSideBlocked(int i) {
return false;
}
@Override
public void setPos(BlockPos pos) {
}
};
}
@Override
public boolean isActive() {
return false;
}
@Override
public void registerPipeInformationProvider() {
}
@Override
public boolean isItemDuct(TileEntity tile) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void renderPipeConnections(LogisticsTileGenericPipe pipeTile, List<RenderEntry> list) {
}
@Override
public void registerTextures(TextureMap iconRegister) {
}
@Override
public boolean isBlockedSide(TileEntity with, EnumFacing opposite) {
return false;
}
}, ITDPart.class));
SimpleServiceLocator.setMCMPProxy(ProxyManager.getWrappedProxy(LPConstants.mcmpModID, IMCMPProxy.class, MCMPProxy.class, new IMCMPProxy() {
@Override
public IMCMPLTGPCompanion createMCMPCompanionFor(LogisticsTileGenericPipe pipe) {
return new IMCMPLTGPCompanion() {
@Override
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) {
return false;
}
@Nullable
@Override
public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) {
return null;
}
@Override
public NBTTagCompound getUpdateTag() {
return new NBTTagCompound();
}
@Override
public void handleUpdateTag(NBTTagCompound tag) {
}
@Override
public TileEntity getMCMPTileEntity() {
return null;
}
@Override
public void update() {
}
};
}
@Override
public IMCMPBlockAccess createMCMPBlockAccess() {
return new IMCMPBlockAccess() {
@Override
public void addBlockState(BlockStateContainer.Builder builder) {
}
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return state;
}
@Override
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entity, boolean isActualState) {
}
@Override
public RayTraceResult collisionRayTrace(IBlockState state, World world, BlockPos pos, Vec3d start, Vec3d end) {
return null;
}
@Override
public Block getBlock() {
return null;
}
@Override
public void addDrops(NonNullList<ItemStack> list, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
}
};
}
@Override
public void addQuads(@Nonnull List<BakedQuad> list, IBlockState state, EnumFacing side, long rand) {
}
@Override
public void registerTileEntities() {
}
@Override
public boolean checkIntersectionWith(LogisticsTileGenericPipe logisticsTileGenericPipe, AxisAlignedBB aabb) {
return false;
}
@Override
public boolean hasParts(LogisticsTileGenericPipe pipeTile) {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void renderTileEntitySpecialRenderer(LogisticsTileGenericPipe tileentity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
}
}, IMCMPLTGPCompanion.class));
final IBounds dummyBounds = new IBounds() {
@Override
public IVec3 min() {
return new IVec3() {
@Override
public double x() {
return 0;
}
@Override
public double y() {
return 0;
}
@Override
public double z() {
return 0;
}
@Override
public Object getOriginal() {
return null;
}
};
}
@Override
public IVec3 max() {
return new IVec3() {
@Override
public double x() {
return 0;
}
@Override
public double y() {
return 0;
}
@Override
public double z() {
return 0;
}
@Override
public Object getOriginal() {
return null;
}
};
}
@Override
public AxisAlignedBB toAABB() {
return null;
}
};
final IModel3D dummy3DModel = new IModel3D() {
@Override
public IModel3D backfacedCopy() {
return this;
}
@Override
public void render(I3DOperation... i3dOperations) {
}
@Override
public List<BakedQuad> renderToQuads(VertexFormat format, I3DOperation... i3dOperations) {
return Lists.newArrayList();
}
@Override
public void computeNormals() {
}
@Override
public void computeStandardLighting() {
}
@Override
public IBounds bounds() {
return dummyBounds;
}
@Override
public IModel3D apply(I3DOperation translation) {
return this;
}
@Override
public IModel3D copy() {
return this;
}
@Override
public IModel3D twoFacedCopy() {
return this;
}
@Override
public Object getOriginal() {
return this;
}
@Override
public IBounds getBoundsInside(AxisAlignedBB boundingBox) {
return dummyBounds;
}
};
ICCLProxy dummyCCLProxy = new ICCLProxy() {
@SideOnly(Side.CLIENT)
@Override
public TextureTransformation createIconTransformer(TextureAtlasSprite registerIcon) {
return new TextureTransformation() {
@Override
public Object getOriginal() {
return null;
}
@Override
public void update(TextureAtlasSprite registerIcon) {
}
@Override
public TextureAtlasSprite getTexture() {
return null;
}
};
}
@Override
public IRenderState getRenderState() {
return new IRenderState() {
@Override
public void reset() {
}
@Override
public void setAlphaOverride(int i) {
}
@Override
public void draw() {
}
@Override
public void setBrightness(IBlockAccess world, BlockPos pos) {
}
@Override
public void startDrawing(int mode, VertexFormat format) {
}
};
}
@Override
public Map<String, IModel3D> parseObjModels(InputStream resourceAsStream, int i, LPScale scale) {
return new HashMap<>();
}
@Override
public Object getRotation(int i, int j) {
return null;
}
@Override
public Object getScale(double d, double e, double f) {
return null;
}
@Override
public Object getScale(double d) {
return null;
}
@Override
public ITranslation getTranslation(double d, double e, double f) {
return new ITranslation() {
@Override
public ITranslation inverse() {
return this;
}
@Override
public Object getOriginal() {
return null;
}
};
}
@Override
public ITranslation getTranslation(IVec3 min) {
return new ITranslation() {
@Override
public ITranslation inverse() {
return this;
}
@Override
public Object getOriginal() {
return null;
}
};
}
@Override
public Object getUVScale(double i, double d) {
return null;
}
@Override
public Object getUVTranslation(float i, float f) {
return null;
}
@Override
public Object getUVTransformationList(I3DOperation[] uvTranslation) {
return null;
}
@Override
public IModel3D wrapModel(Object model) {
return dummy3DModel;
}
@Override
public boolean isActivated() {
return false;
}
@Override
public Object getRotation(double d, int i, int j, int k) {
return null;
}
@Override
public IModel3D combine(Collection<IModel3D> list) {
return dummy3DModel;
}
@Override
public Object getColourMultiplier(int i) {
return null;
}
@Override
public IModelState getDefaultBlockState() {
return null;
}
};
// @formatter:on
// CHECKSTYLE:ON
Class<?>[] cclSubWrapper = new Class<?>[] { TextureTransformation.class, IRenderState.class, IModel3D.class, ITranslation.class, IVec3.class, IBounds.class };
SimpleServiceLocator.setCCLProxy(ProxyManager.getWrappedProxy("!" + LPConstants.cclrenderModID, ICCLProxy.class, CCLProxy.class, dummyCCLProxy, cclSubWrapper));
SimpleServiceLocator.setConfigToolHandler(new ConfigToolHandler());
SimpleServiceLocator.configToolHandler.registerWrapper();
SimpleServiceLocator.setPowerProxy(new PowerProxy());
}
Aggregations