More Rendering Fixes
This commit is contained in:
@@ -66,7 +66,7 @@ public class BlockCharger extends AEBaseTileBlock<TileCharger>
|
||||
|
||||
public BlockCharger()
|
||||
{
|
||||
super( Properties.create(Material.IRON) );
|
||||
super( Properties.create(Material.IRON).notSolid() );
|
||||
|
||||
this.setFullSize( this.setOpaque( false ) );
|
||||
}
|
||||
|
||||
@@ -26,10 +26,12 @@ import appeng.container.implementations.ContainerWireless;
|
||||
import appeng.helpers.AEGlassMaterial;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.state.EnumProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -65,36 +67,30 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
|
||||
|
||||
public BlockWireless()
|
||||
{
|
||||
super( Properties.create(AEGlassMaterial.INSTANCE) );
|
||||
super( Properties.create(AEGlassMaterial.INSTANCE).notSolid() );
|
||||
this.setFullSize( false );
|
||||
this.setOpaque( false );
|
||||
this.setDefaultState( this.getDefaultState().with( STATE, State.OFF ) );
|
||||
}
|
||||
|
||||
// FIXME This has to be triggered by the tile entity's state changing directly
|
||||
@Override
|
||||
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld world, BlockPos pos, BlockPos facingPos) {
|
||||
protected BlockState updateBlockStateFromTileEntity(BlockState currentState, TileWireless te) {
|
||||
State teState = State.OFF;
|
||||
|
||||
TileWireless te = this.getTileEntity( world, pos );
|
||||
if( te != null )
|
||||
if( te.isActive() )
|
||||
{
|
||||
if( te.isActive() )
|
||||
{
|
||||
teState = State.HAS_CHANNEL;
|
||||
}
|
||||
else if( te.isPowered() )
|
||||
{
|
||||
teState = State.ON;
|
||||
}
|
||||
teState = State.HAS_CHANNEL;
|
||||
}
|
||||
else if( te.isPowered() )
|
||||
{
|
||||
teState = State.ON;
|
||||
}
|
||||
|
||||
return super.updatePostPlacement(stateIn, facing, facingState, world, pos, facingPos)
|
||||
.with( STATE, teState );
|
||||
return currentState.with(STATE, teState);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder builder) {
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(STATE);
|
||||
}
|
||||
@@ -173,7 +169,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
|
||||
|
||||
return VoxelShapes.create( new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ ) );
|
||||
}
|
||||
return VoxelShapes.fullCube();
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -237,7 +233,7 @@ public class BlockWireless extends AEBaseTileBlock<TileWireless>
|
||||
}
|
||||
else
|
||||
{
|
||||
return VoxelShapes.fullCube();
|
||||
return VoxelShapes.empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ public class PaintRendering extends BlockRenderingCustomizer
|
||||
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
|
||||
{
|
||||
rendering.renderType(RenderType.getCutout());
|
||||
// FIXME rendering.builtInModel( "models/block/paint", new PaintModel() );
|
||||
// Disable auto rotation
|
||||
rendering.modelCustomizer( ( location, model ) -> model );
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ import net.minecraftforge.client.model.data.IModelData;
|
||||
class PaintSplotchesBakedModel implements IDynamicBakedModel
|
||||
{
|
||||
|
||||
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "blocks/paint1" ));
|
||||
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/paint2" ));
|
||||
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/paint3" ));
|
||||
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "block/paint1" ));
|
||||
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/paint2" ));
|
||||
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/paint3" ));
|
||||
|
||||
private final TextureAtlasSprite[] textures;
|
||||
|
||||
|
||||
@@ -27,10 +27,10 @@ import java.util.function.Function;
|
||||
class QnbFormedBakedModel implements IDynamicBakedModel
|
||||
{
|
||||
|
||||
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "blocks/quantum_link" ));
|
||||
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring" ));
|
||||
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring_light" ));
|
||||
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/quantum_ring_light_corner" ));
|
||||
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "block/quantum_link" ));
|
||||
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring" ));
|
||||
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring_light" ));
|
||||
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/quantum_ring_light_corner" ));
|
||||
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "parts/cable/glass/transparent" ));
|
||||
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "parts/cable/covered/transparent" ));
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -56,7 +57,7 @@ public class BlockChest extends AEBaseTileBlock<TileChest>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(StateContainer.Builder builder) {
|
||||
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.fillStateContainer(builder);
|
||||
builder.add(SLOT_STATE);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ package appeng.bootstrap;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.bootstrap.components.BlockColorComponent;
|
||||
import appeng.bootstrap.components.RenderTypeComponent;
|
||||
import appeng.bootstrap.components.TileEntityRendererComponent;
|
||||
import appeng.client.render.model.AutoRotatingBakedModel;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
@@ -105,12 +105,12 @@ class BlockRendering implements IBlockRendering
|
||||
{
|
||||
// This is a default rotating model if the base-block uses an AE tile entity which exposes UP/FRONT as
|
||||
// extended props
|
||||
// FIXME factory.addModelOverride( block.getRegistryName().getPath(), ( l, m ) -> new AutoRotatingModel( m ) );
|
||||
factory.addModelOverride( block.getRegistryName().getPath(), ( l, m ) -> new AutoRotatingBakedModel( m ) );
|
||||
}
|
||||
|
||||
// TODO : 1.12
|
||||
this.builtInModels.forEach( factory::addBuiltInModel );
|
||||
|
||||
// TODO : 1.12
|
||||
if( this.blockColor != null )
|
||||
{
|
||||
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
import appeng.bootstrap.IBootstrapComponent;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
|
||||
public interface IModelBakeComponent extends IBootstrapComponent {
|
||||
|
||||
void onModelBakeEvent(ModelBakeEvent event);
|
||||
|
||||
}
|
||||
@@ -29,15 +29,12 @@ import com.google.common.collect.Sets;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ModelBakery;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
|
||||
|
||||
public class ModelOverrideComponent implements IPreInitComponent
|
||||
public class ModelOverrideComponent implements IModelBakeComponent
|
||||
{
|
||||
|
||||
// Maps from resource path to customizer
|
||||
@@ -48,13 +45,6 @@ public class ModelOverrideComponent implements IPreInitComponent
|
||||
this.customizer.put( resourcePath, customizer );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInitialize( Dist dist )
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelBakeEvent( final ModelBakeEvent event )
|
||||
{
|
||||
Map<ResourceLocation, IBakedModel> modelRegistry = event.getModelRegistry();
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.bootstrap.components;
|
||||
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a TESR for a given tile entity class.
|
||||
*
|
||||
* @param <T>
|
||||
*/
|
||||
public class TileEntityRendererComponent<T extends AEBaseTile> implements IPreInitComponent
|
||||
{
|
||||
|
||||
private final TileEntityType<T> tileEntityType;
|
||||
|
||||
private final Function<? super TileEntityRendererDispatcher, ? extends TileEntityRenderer<? super T>> tileEntityRenderer;
|
||||
|
||||
public TileEntityRendererComponent(TileEntityType<T> tileEntityType,
|
||||
Function<? super TileEntityRendererDispatcher, ? extends TileEntityRenderer<? super T>> tileEntityRenderer)
|
||||
{
|
||||
this.tileEntityType = tileEntityType;
|
||||
this.tileEntityRenderer = tileEntityRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
// public void modelReg( Dist dist )
|
||||
public void preInitialize( Dist dist )
|
||||
{
|
||||
ClientRegistry.bindTileEntityRenderer( tileEntityType, tileEntityRenderer);
|
||||
}
|
||||
}
|
||||
@@ -408,6 +408,7 @@ public class CubeBuilder
|
||||
if( e.getIndex() == 0 )
|
||||
{
|
||||
builder.put( i, u, v );
|
||||
break;
|
||||
}
|
||||
else if( e.getIndex() == 2 && renderFullBright )
|
||||
{
|
||||
@@ -416,8 +417,8 @@ public class CubeBuilder
|
||||
final float lightMapU = (float) ( 15 * 0x20 ) / 0xFFFF;
|
||||
final float lightMapV = (float) ( 15 * 0x20 ) / 0xFFFF;
|
||||
builder.put( i, lightMapU, lightMapV );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
builder.put( i );
|
||||
break;
|
||||
|
||||
@@ -117,6 +117,6 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel>
|
||||
|
||||
private static Material texture( String name )
|
||||
{
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "blocks/crafting/" + name));
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation(AppEng.MOD_ID, "block/crafting/" + name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package appeng.client.render.effects;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.sun.javafx.geom.Vec3f;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.particles.IParticleData;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.util.Locale;
|
||||
*/
|
||||
public class LightningArcParticleData implements IParticleData {
|
||||
|
||||
public final Vec3f target;
|
||||
public final Vec3d target;
|
||||
|
||||
public LightningArcParticleData(Vec3f target) {
|
||||
public LightningArcParticleData(Vec3d target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class LightningArcParticleData implements IParticleData {
|
||||
float y = reader.readFloat();
|
||||
reader.expect(' ');
|
||||
float z = reader.readFloat();
|
||||
return new LightningArcParticleData(new Vec3f(x, y, z));
|
||||
return new LightningArcParticleData(new Vec3d(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -37,7 +37,7 @@ public class LightningArcParticleData implements IParticleData {
|
||||
float x = buffer.readFloat();
|
||||
float y = buffer.readFloat();
|
||||
float z = buffer.readFloat();
|
||||
return new LightningArcParticleData(new Vec3f(x, y, z));
|
||||
return new LightningArcParticleData(new Vec3d(x, y, z));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,9 +48,9 @@ public class LightningArcParticleData implements IParticleData {
|
||||
|
||||
@Override
|
||||
public void write(PacketBuffer buffer) {
|
||||
buffer.writeFloat(target.x);
|
||||
buffer.writeFloat(target.y);
|
||||
buffer.writeFloat(target.z);
|
||||
buffer.writeFloat((float) target.x);
|
||||
buffer.writeFloat((float) target.y);
|
||||
buffer.writeFloat((float) target.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -160,7 +160,7 @@ public class AutoRotatingBakedModel implements IBakedModel
|
||||
|
||||
if( forward == null || up == null )
|
||||
{
|
||||
return this.parent.getQuads( state, side, rand );
|
||||
return this.parent.getQuads( state, side, rand, extraData );
|
||||
}
|
||||
|
||||
// The model has other properties than just forward/up, so it would cause our cache to inadvertendly also cache
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.minecraft.client.renderer.model.*;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.IModelConfiguration;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class AutoRotatingModel implements IModelGeometry<AutoRotatingModel> {
|
||||
|
||||
private final BlockModel blockModel;
|
||||
|
||||
public AutoRotatingModel(BlockModel blockModel) {
|
||||
this.blockModel = blockModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) {
|
||||
return new AutoRotatingBakedModel(
|
||||
this.blockModel.bakeModel(bakery, this.blockModel, spriteGetter, modelTransform, modelLocation, true)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
return this.blockModel.getTextures(modelGetter, missingTextureErrors);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package appeng.client.render.model;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.client.renderer.model.BlockModel;
|
||||
import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraftforge.client.model.IModelLoader;
|
||||
|
||||
public class AutoRotatingModelLoader implements IModelLoader<AutoRotatingModel> {
|
||||
|
||||
public static final AutoRotatingModelLoader INSTANCE = new AutoRotatingModelLoader();
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AutoRotatingModel read(JsonDeserializationContext deserializationContext, JsonObject modelContents) {
|
||||
modelContents.remove("loader");
|
||||
BlockModel blockModel = deserializationContext.deserialize(modelContents, BlockModel.class);
|
||||
return new AutoRotatingModel(blockModel);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class SpatialPylonModel implements IModelGeometry<SpatialPylonModel>
|
||||
|
||||
private static Material getTexturePath( SpatialPylonTextureType type )
|
||||
{
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "blocks/spatial_pylon/" + type.name().toLowerCase() ) );
|
||||
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, new ResourceLocation( AppEng.MOD_ID, "block/spatial_pylon/" + type.name().toLowerCase() ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class InscriberTESR extends TileEntityRenderer<TileInscriber>
|
||||
|
||||
private static final float ITEM_RENDER_SCALE = 1.0f / 1.2f;
|
||||
|
||||
private static final ResourceLocation TEXTURE_INSIDE = new ResourceLocation( AppEng.MOD_ID, "blocks/inscriber_inside" );
|
||||
private static final ResourceLocation TEXTURE_INSIDE = new ResourceLocation( AppEng.MOD_ID, "block/inscriber_inside" );
|
||||
|
||||
private static TextureAtlasSprite textureInside;
|
||||
|
||||
|
||||
@@ -144,6 +144,7 @@ public final class AppEng
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(this::clientSetup));
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(registration::modelRegistryEvent));
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(registration::registerItemColors));
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(registration::handleModelBake));
|
||||
|
||||
MinecraftForge.EVENT_BUS.addListener( TickHandler.INSTANCE::unloadWorld );
|
||||
MinecraftForge.EVENT_BUS.addListener( TickHandler.INSTANCE::onTick );
|
||||
@@ -203,7 +204,6 @@ public final class AppEng
|
||||
addBuiltInModel("paint_splotches", PaintSplotchesModel::new);
|
||||
addBuiltInModel("quantum_bridge_formed", QnbFormedModel::new);
|
||||
ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "crafting_cube"), CraftingCubeModelLoader.INSTANCE);
|
||||
ModelLoaderRegistry.registerLoader(new ResourceLocation(AppEng.MOD_ID, "auto_rotating"), AutoRotatingModelLoader.INSTANCE);
|
||||
}
|
||||
|
||||
private static <T extends IModelGeometry<T>> void addBuiltInModel(String id, Supplier<T> modelFactory) {
|
||||
|
||||
@@ -104,14 +104,12 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.ColorHandlerEvent;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.event.*;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.crafting.CraftingHelper;
|
||||
import net.minecraftforge.common.extensions.IForgeContainerType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.loading.FMLEnvironment;
|
||||
@@ -888,4 +886,9 @@ final class Registration
|
||||
definitions.getRegistry().getBootstrapComponents( IItemColorRegistrationComponent.class ).forEachRemaining(c -> c.register(event.getItemColors(), event.getBlockColors()));
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void handleModelBake(ModelBakeEvent event) {
|
||||
final ApiDefinitions definitions = Api.INSTANCE.definitions();
|
||||
definitions.getRegistry().getBootstrapComponents( IModelBakeComponent.class ).forEachRemaining(c -> c.onModelBakeEvent(event));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import appeng.block.grindstone.BlockGrinder;
|
||||
import appeng.block.misc.*;
|
||||
import appeng.block.networking.*;
|
||||
import appeng.block.paint.BlockPaint;
|
||||
import appeng.block.paint.PaintRendering;
|
||||
import appeng.block.qnb.BlockQuantumLinkChamber;
|
||||
import appeng.block.qnb.BlockQuantumRing;
|
||||
import appeng.block.qnb.QuantumBridgeRendering;
|
||||
@@ -494,7 +495,7 @@ public final class ApiBlocks implements IBlocks
|
||||
this.paint = registry.block( "paint", BlockPaint::new )
|
||||
.features( AEFeature.PAINT_BALLS )
|
||||
.tileEntity( registry.tileEntity("paint", TilePaint.class, TilePaint::new).build() )
|
||||
// FIXME .rendering( new PaintRendering() )
|
||||
.rendering( new PaintRendering() )
|
||||
.build();
|
||||
|
||||
this.skyStoneStairs = deco.block( "sky_stone_stairs", () -> new StairsBlock(this.skyStoneBlock().block()::getDefaultState, SKYSTONE_PROPERTIES ) )
|
||||
|
||||
@@ -297,6 +297,9 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
||||
// TODO: Optimize Network Load
|
||||
if( this.world != null )
|
||||
{
|
||||
this.requestModelDataUpdate();
|
||||
|
||||
boolean alreadyUpdated = false;
|
||||
// Let the block update it's own state with our internal state changes
|
||||
BlockState currentState = getBlockState();
|
||||
if (currentState.getBlock() instanceof AEBaseTileBlock) {
|
||||
@@ -305,10 +308,13 @@ public class AEBaseTile extends TileEntity implements IOrientable, ICommonTile,
|
||||
if (currentState != newState) {
|
||||
AELog.blockUpdate(this.pos, currentState, newState, this);
|
||||
this.world.setBlockState(pos, newState);
|
||||
alreadyUpdated = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.requestModelDataUpdate();
|
||||
if (!alreadyUpdated) {
|
||||
this.world.notifyBlockUpdate(this.pos, currentState, currentState, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user