Remove old cables
This commit is contained in:
parent
007e8714fa
commit
624d8fb93a
32 changed files with 53 additions and 1733 deletions
|
@ -29,7 +29,6 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockOre2;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
|
@ -38,8 +37,6 @@ import techreborn.config.ConfigTechReborn;
|
|||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.*;
|
||||
import techreborn.parts.TechRebornParts;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
|
||||
public class RegisterItemJsons {
|
||||
public static void registerModels() {
|
||||
|
@ -179,12 +176,6 @@ public class RegisterItemJsons {
|
|||
String[] name = BlockStorage2.types.clone();
|
||||
registerBlockstate(ModBlocks.STORAGE2, i, name[i]);
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("reborncore-mcmultipart"))
|
||||
for (EnumCableType i : EnumCableType.values()) {
|
||||
String name = i.getName();
|
||||
registerBlockstate(TechRebornParts.cables, i.ordinal(), name, "items/misc/");
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.render.parts;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 05/03/2016.
|
||||
*/
|
||||
public class ClientPartLoader implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.render.parts;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 04/03/2016.
|
||||
*/
|
||||
public class ClientPartModelBakery {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onModelBake(ModelBakeEvent event) {
|
||||
for (EnumCableType type : EnumCableType.values()) {
|
||||
event.getModelRegistry().putObject(
|
||||
new ModelResourceLocation("techreborn:cable", "type=" + type.getName().toLowerCase()),
|
||||
new RenderCablePart(type));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void textureStichEvent(TextureStitchEvent event) {
|
||||
for (EnumCableType type : EnumCableType.values()) {
|
||||
event.getMap().registerSprite(new ResourceLocation(type.textureName));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.render.parts;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.*;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import reborncore.client.models.BakedModelUtils;
|
||||
import reborncore.common.misc.vecmath.Vecs3dCube;
|
||||
import techreborn.parts.powerCables.CableMultipart;
|
||||
import techreborn.parts.powerCables.EnumCableType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class RenderCablePart implements IBakedModel {
|
||||
|
||||
EnumCableType type;
|
||||
private FaceBakery faceBakery = new FaceBakery();
|
||||
private TextureAtlasSprite texture;
|
||||
|
||||
public RenderCablePart(EnumCableType type) {
|
||||
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand) {
|
||||
type = blockState.getValue(CableMultipart.TYPE);
|
||||
texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName);
|
||||
ArrayList<BakedQuad> list = new ArrayList<>();
|
||||
BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0F, 0.0F, 16.0F, 16.0F }, 0);
|
||||
BlockPartFace face = new BlockPartFace(null, 0, "", uv);
|
||||
double thickness = type.cableThickness;
|
||||
double lastThickness = 16 - thickness;
|
||||
IExtendedBlockState state = (IExtendedBlockState) blockState;
|
||||
if (side != null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, null, faceBakery);
|
||||
if (state != null) {
|
||||
if (state.getValue(CableMultipart.UP)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, EnumFacing.UP, faceBakery);
|
||||
}
|
||||
if (state.getValue(CableMultipart.DOWN)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y0, texture, EnumFacing.DOWN, faceBakery);
|
||||
}
|
||||
if (state.getValue(CableMultipart.NORTH)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y90, texture, EnumFacing.NORTH, faceBakery);
|
||||
}
|
||||
if (state.getValue(CableMultipart.SOUTH)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness),
|
||||
list, face, ModelRotation.X0_Y270, texture, EnumFacing.SOUTH, faceBakery);
|
||||
}
|
||||
if (state.getValue(CableMultipart.EAST)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(lastThickness, thickness, thickness, 16.0, lastThickness, lastThickness),
|
||||
list, face, ModelRotation.X0_Y0, texture, EnumFacing.EAST, faceBakery);
|
||||
}
|
||||
if (state.getValue(CableMultipart.WEST)) {
|
||||
BakedModelUtils.addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list,
|
||||
face, ModelRotation.X0_Y0, texture, EnumFacing.WEST, faceBakery);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGui3d() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
return ItemCameraTransforms.DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue