mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 01:54:59 +00:00
add walrus
This commit is contained in:
1 parent
2a249bf5a4
commit
3f35dadb41
15 files changed
+8892
-4
No files matched your search
@@ -0,0 +1,61 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ItemWalrusRender implements IItemRenderer {
|
||||
IModelCustom modelWalrus = AdvancedModelLoader.loadModel(FluidCraft.resource("models/walrus.obj"));
|
||||
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
|
||||
|
||||
public ItemWalrusRender() {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileWalrus.class, new RenderBlockWalrus());
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ItemAndBlockHolder.WALRUS), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
|
||||
GL11.glPushMatrix();
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
break;
|
||||
case EQUIPPED:
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glTranslatef(-1F, 0.5F, -0.5F);
|
||||
break;
|
||||
case FIRST_PERSON_MAP:
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.1F);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.modelWalrus.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(
|
||||
IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.glodblock.github.client.render;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class RenderBlockWalrus extends TileEntitySpecialRenderer {
|
||||
IModelCustom modelWalrus = AdvancedModelLoader.loadModel(FluidCraft.resource("models/walrus.obj"));
|
||||
ResourceLocation textureWalrus = FluidCraft.resource("textures/blocks/walrus.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partialTickTime) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
int orientation = tileentity.getBlockMetadata();
|
||||
if (orientation == 4) {
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
} else if (orientation == 5) {
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
} else if (orientation == 3) {
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
}
|
||||
this.modelWalrus.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class BaseBlockContainer extends BlockContainer {
|
||||
|
||||
public BaseBlockContainer(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
public void addInformation(
|
||||
ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips) {}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import com.glodblock.github.common.item.BaseItemBlockContainer;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockWalrus extends BaseBlockContainer {
|
||||
|
||||
public BlockWalrus() {
|
||||
super(Material.clay);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setBlockName(NameConst.BLOCK_WALRUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileWalrus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) {
|
||||
int l = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
if (l == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
|
||||
if (l == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
}
|
||||
|
||||
if (l == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
}
|
||||
|
||||
if (l == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
switch (ForgeDirection.getOrientation(blockAccess.getBlockMetadata(x, y, z))) {
|
||||
case NORTH:
|
||||
setBlockBounds(0.0F, 0.0F, -1.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case EAST:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 2.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
case SOUTH:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 2.0F);
|
||||
break;
|
||||
case WEST:
|
||||
setBlockBounds(-1.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
default:
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public BlockWalrus register() {
|
||||
GameRegistry.registerBlock(this, BaseItemBlockContainer.class, NameConst.BLOCK_WALRUS);
|
||||
GameRegistry.registerTileEntity(TileWalrus.class, NameConst.BLOCK_WALRUS);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_WALRUS_DESC));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import com.glodblock.github.common.block.BaseBlockContainer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BaseItemBlockContainer extends ItemBlock {
|
||||
private final BaseBlockContainer blockType;
|
||||
|
||||
public BaseItemBlockContainer(Block id) {
|
||||
super(id);
|
||||
this.blockType = (BaseBlockContainer) id;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedToolTips) {
|
||||
blockType.addInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.glodblock.github.common.tile;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileWalrus extends TileEntity {
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class ItemAndBlockHolder {
|
||||
public static BlockFluidBuffer FLUID_BUFFER = new BlockFluidBuffer().register();
|
||||
public static BlockLargeIngredientBuffer LARGE_BUFFER = new BlockLargeIngredientBuffer().register();
|
||||
public static BlockOCPatternEditor OC_EDITOR = new BlockOCPatternEditor().register();
|
||||
|
||||
public static BlockWalrus WALRUS = new BlockWalrus().register();
|
||||
public static ItemFluidDrop DROP = new ItemFluidDrop().register();
|
||||
public static ItemFluidEncodedPattern PATTERN = new ItemFluidEncodedPattern().register();
|
||||
public static ItemPartFluidTerminal FLUID_TERM = new ItemPartFluidTerminal().register();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.glodblock.github.loader;
|
||||
|
||||
import static com.glodblock.github.loader.ItemAndBlockHolder.*;
|
||||
import static net.minecraft.init.Blocks.redstone_torch;
|
||||
import static net.minecraft.init.Items.fish;
|
||||
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.item.ItemBasicFluidStorageCell;
|
||||
@@ -162,6 +163,7 @@ public class RecipeLoader implements Runnable {
|
||||
AE2_CORE_FOM,
|
||||
'B',
|
||||
BUCKET));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(WALRUS, "FFF", "F F", "FFF", 'F', fish));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
FLUID_LEVEL_EMITTER.stack(), "RPD", 'R', redstone_torch, 'P', AE2_PROCESS_CAL, 'D', "dyeBlue"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.glodblock.github.loader;
|
||||
|
||||
import com.glodblock.github.client.render.ItemDropRender;
|
||||
import com.glodblock.github.client.render.ItemPacketRender;
|
||||
import com.glodblock.github.client.render.ItemWalrusRender;
|
||||
|
||||
public class RenderLoader implements Runnable {
|
||||
|
||||
@@ -9,5 +10,6 @@ public class RenderLoader implements Runnable {
|
||||
public void run() {
|
||||
new ItemDropRender();
|
||||
new ItemPacketRender();
|
||||
new ItemWalrusRender();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.glodblock.github.proxy;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.Config;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
import com.glodblock.github.inventory.external.AEFluidInterfaceHandler;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
@@ -20,7 +22,9 @@ public class CommonProxy {
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event) {}
|
||||
|
||||
public void init(FMLInitializationEvent event) {}
|
||||
public void init(FMLInitializationEvent event) {
|
||||
this.registerMovables();
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (ModAndClassUtil.isBigInterface) {
|
||||
@@ -45,4 +49,11 @@ public class CommonProxy {
|
||||
}
|
||||
AEApi.instance().registries().externalStorage().addExternalStorageInterface(new AEFluidInterfaceHandler());
|
||||
}
|
||||
|
||||
public void registerRenderers() {}
|
||||
|
||||
public void registerMovables() {
|
||||
IAppEngApi api = AEApi.instance();
|
||||
api.registries().movable().whiteListTileEntity(TileWalrus.class);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class NameConst {
|
||||
public static final String BLOCK_LARGE_INGREDIENT_BUFFER = "large_ingredient_buffer";
|
||||
public static final String BLOCK_OC_PATTERN_EDITOR = "oc_pattern_editor";
|
||||
public static final String BLOCK_LEVEL_MAINTAINER = "level_maintainer";
|
||||
|
||||
public static final String BLOCK_WALRUS = "walrus";
|
||||
public static final String ITEM_FLUID_DROP = "fluid_drop";
|
||||
public static final String ITEM_FLUID_ENCODED_PATTERN = "fluid_encoded_pattern";
|
||||
public static final String ITEM_PART_FLUID_STORAGE_MONITOR = "part_fluid_storage_monitor";
|
||||
@@ -42,6 +42,8 @@ public class NameConst {
|
||||
public static final String TT_DUMP_TANK = TT_KEY + "dump_tank";
|
||||
public static final String TT_SHIFT_FOR_MORE = TT_KEY + "shift_for_more";
|
||||
public static final String TT_CTRL_FOR_MORE = TT_KEY + "ctrl_for_more";
|
||||
public static final String TT_WALRUS = TT_KEY + "walrus.";
|
||||
public static final String TT_WALRUS_DESC = TT_WALRUS + "desc";
|
||||
public static final String TT_FLUID_BUFFER = TT_KEY + "fluid_buffer.";
|
||||
public static final String TT_FLUID_PACKET_DECODER = TT_KEY + "fluid_packet_decoder.";
|
||||
public static final String TT_FLUID_PACKET_DECODER_DESC = TT_FLUID_PACKET_DECODER + "desc";
|
||||
|
||||
@@ -35,6 +35,7 @@ tile.large_ingredient_buffer.name=Large Ingredient Buffer
|
||||
tile.oc_pattern_editor.name=OC Pattern Editor
|
||||
tile.level_maintainer.name=ME Level Maintainer
|
||||
tile.fluid_buffer.name=ME Fluid Buffer
|
||||
tile.walrus.name=Walrus
|
||||
|
||||
ae2fc.waila.speed=Speed
|
||||
ae2fc.waila.enable=Enable
|
||||
@@ -45,6 +46,7 @@ ae2fc.tooltip.ctrl_for_more=§r> Hold §3Ctrl§r for more information
|
||||
ae2fc.tooltip.fluid_packet_decoder.desc=The Fluid Decoder can decode Fluid packets. It has to be connected to a ME System and a place to store the liquid in otherwise it won't work.
|
||||
ae2fc.tooltip.discretizer.desc=When the ME Fluid Discretizer is attached to your ME System, it will represent the Fluids that are stored in your ME Fluid Storage Cells (Or Storage bus) as drops. They will be the item equivalent of fluids. Its just another way to show fluids, it won't actually convert your fluids to items.
|
||||
ae2fc.tooltip.fluid_buffer.desc=This is a high speed fluid IO
|
||||
ae2fc.tooltip.walrus.desc=GTNH is like a job
|
||||
ae2fc.tooltip.level_maintainer.Who_Am_I=Who Am I?
|
||||
ae2fc.tooltip.level_maintainer.title=§6Request Status§r
|
||||
ae2fc.tooltip.level_maintainer.desc=Automatically keeps items and fluids in stock by requesting new crafts when needed. Has to be connected to an ME network.
|
||||
|
||||
@@ -35,15 +35,18 @@ tile.large_ingredient_buffer.name=大型原材料缓存仓
|
||||
tile.oc_pattern_editor.name=OC样板编辑器
|
||||
tile.level_maintainer.name=ME库存维持器
|
||||
tile.fluid_buffer.name=ME流体缓存器
|
||||
tile.walrus.name=海象
|
||||
|
||||
ae2fc.waila.speed=速度
|
||||
ae2fc.waila.enable=启用
|
||||
ae2fc.waila.disable=禁用
|
||||
|
||||
ae2fc.tooltip.shift_for_more=> 按 §3Shift§r 显示更多信息
|
||||
ae2fc.tooltip.shift_for_more=§r> 按 §3Shift§r 显示更多信息
|
||||
ae2fc.tooltip.ctrl_for_more=§r> 按 §3Ctrl§r 显示更多信息
|
||||
ae2fc.tooltip.fluid_packet_decoder.desc=流体解码器可以解码液体数据包。它必须与ME系统连接,并且网络内可以储存流体,否则它就无法工作。
|
||||
ae2fc.tooltip.discretizer.desc=当ME流体离散器连接到您的ME系统时,它将把存储在的ME流体存储单元(或存储总线)中的流体表现为物品液滴。它们将是流体的等价物。它只是显示流体的另一种方式,它不会真正把你的流体转换成物品。
|
||||
ae2fc.tooltip.fluid_buffer.desc=这就是一个高速的流体IO接口
|
||||
ae2fc.tooltip.walrus.desc=GTNH is like a job
|
||||
ae2fc.tooltip.level_maintainer.Who_Am_I=Who Am I?
|
||||
ae2fc.tooltip.level_maintainer.title=§6请求状态§r
|
||||
ae2fc.tooltip.level_maintainer.desc=通过在需要时请求合成,自动保持物品和流体的库存。必须连接到ME网络。
|
||||
@@ -61,6 +64,7 @@ ae2fc.tooltip.level_maintainer.request_size=§6缓存量§r
|
||||
ae2fc.tooltip.level_maintainer.request_size.hint=数量定义了在请求器开始请求新合成之前应该保留多少物品。
|
||||
|
||||
ae2fc.tooltip.cell_contents=内含流体:
|
||||
ae2fc.tooltip.cell_empty=Cell is empty
|
||||
ae2fc.tooltip.fluid_terminal=我们不再需要EC2了吗?
|
||||
ae2fc.tooltip.invalid_fluid=流体无效!
|
||||
ae2fc.tooltip.encode_pattern=编写样板
|
||||
@@ -101,6 +105,7 @@ ae2fc.gui.part_fluid_level_emitter=ME流体发信器
|
||||
ae2fc.gui.part_fluid_import=ME流体输入总线
|
||||
ae2fc.gui.part_fluid_export=ME流体输出总线
|
||||
ae2fc.gui.part_fluid_terminal=流体终端
|
||||
ae2fc.gui.part_fluid_storage_bus=ME流体存储总线
|
||||
|
||||
error.unknown=未知流体
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Reference in new issue
Block a user