Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

[DO NOT MERGE YET] fix testmod compile errors #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/debug/java/org/dimdev/testmod/TestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,42 @@
import static net.minecraft.init.SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP;

public class TestMod implements BlockAdder, ItemAdder, FluidAdder, TextureAdder, PacketAdder, CommandAdder, ClientTickable, /*AmbientMusicTypeProvider,*/ DimensionTypeAdder, MessageAdder {
private static final Logger LOGGER = LogManager.getLogger();

public static final Block WHITE_BLOCK = new Block(Block.Builder.create(Material.ROCK));
public static final Block TRANSLUCENT_WHITE_BLOCK = new BlockStainedGlass(EnumDyeColor.WHITE, Block.Builder.create(Material.GLASS));
public static final FlowingFluid WHITE_FLUID = new WhiteFluid.Source();
public static final FlowingFluid FLOWING_WHITE_FLUID = new WhiteFluid.Flowing();
public static final BlockFlowingFluid BLOCK_WHITE_FLUID = new BlockFlowingFluid(WHITE_FLUID, Block.Builder.create(Material.WATER).doesNotBlockMovement().hardnessAndResistance(100F, 100F).variableOpacity());
public static final Item PACKET_TESTER = new ItemPacketTester(new Item.Builder());
public static final MusicTicker.MusicType TEST_MUSIC = AmbientMusicTypeProvider.newMusicType("test", ENTITY_EXPERIENCE_ORB_PICKUP, 0, 0);
public static final String MODID = "testmod";

private static final Logger LOGGER = LogManager.getLogger();
private int clientTickCount = 0;

@Override
public void registerBlocks() {
Block.register(new ResourceLocation("testmod", "white_block"), WHITE_BLOCK);
Block.register(new ResourceLocation("testmod", "translucent_white_block"), TRANSLUCENT_WHITE_BLOCK);
Block.register(new ResourceLocation("testmod", "white_fluid"), BLOCK_WHITE_FLUID);
Block.register(new ResourceLocation(MODID, "white_block"), WHITE_BLOCK);
Block.register(new ResourceLocation(MODID, "translucent_white_block"), TRANSLUCENT_WHITE_BLOCK);
Block.register(new ResourceLocation(MODID, "white_fluid"), BLOCK_WHITE_FLUID);
}

@Override
public void registerItems() {
Item.registerItemBlock(WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.registerItemBlock(TRANSLUCENT_WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.registerItem(new ResourceLocation("testmod", "packet_tester"), PACKET_TESTER);
Item.register(WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.register(TRANSLUCENT_WHITE_BLOCK, ItemGroup.BUILDING_BLOCKS);
Item.register(new ResourceLocation(MODID, "packet_tester"), PACKET_TESTER);
}

@Override
public void registerFluids() {
Fluid.register(new ResourceLocation("testmod", "white_fluid"), WHITE_FLUID);
Fluid.register(new ResourceLocation("testmod", "flowing_white_fluid"), FLOWING_WHITE_FLUID);
Fluid.register(new ResourceLocation(MODID, "white_fluid"), WHITE_FLUID);
Fluid.register(new ResourceLocation(MODID, "flowing_white_fluid"), FLOWING_WHITE_FLUID);
}

@Override
public Collection<? extends ResourceLocation> getBuiltinTextures() {
return Collections.singletonList(new ResourceLocation("testmod", "block/white_fluid_flow"));
return Collections.singletonList(new ResourceLocation(MODID, "block/white_fluid_flow"));
}

@Override
Expand Down Expand Up @@ -107,6 +110,6 @@ public Set<? extends DimensionType> getDimensionTypes() {

@Override
public void registerMessages(RegistryNamespaced<ResourceLocation, Class<? extends Message>> registry) {
registry.putObject(new ResourceLocation("testmod", "test_message"), TestMessage.class);
registry.put(new ResourceLocation(MODID, "test_message"), TestMessage.class);
}
}
5 changes: 2 additions & 3 deletions src/debug/java/org/dimdev/testmod/WhiteFluid.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public TextureAtlasSprite getStillTexture() {

@Override
public TextureAtlasSprite getFlowingTexture() {
return Minecraft.getMinecraft().getTextureMapBlocks().getSprite(new ResourceLocation("testmod", "block/white_fluid_flow"));
return Minecraft.getMinecraft().getTextureMapBlocks().getSprite(new ResourceLocation(TestMod.MODID, "block/white_fluid_flow"));
}

@Override
Expand All @@ -122,8 +122,7 @@ public static class Flowing extends WhiteFluid {
public Flowing() {}

@Override
protected void buildStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
super.buildStateContainer(builder);
protected void fillStateContainer(StateContainer.Builder<Fluid, IFluidState> builder) {
builder.add(LEVEL_1_TO_8);
}

Expand Down