-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from TheDudeFromCI/ballista
Added Ballista
- Loading branch information
Showing
17 changed files
with
886 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,32 @@ | ||
package me.ci.moregears; | ||
|
||
import com.simibubi.create.foundation.data.CreateRegistrate; | ||
import com.simibubi.create.repack.registrate.util.NonNullLazyValue; | ||
|
||
import me.ci.moregears.registry.ModBlocks; | ||
import me.ci.moregears.registry.ModTags; | ||
import me.ci.moregears.registry.ModItemGroups; | ||
import me.ci.moregears.registry.ModTiles; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.fml.common.Mod; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
@Mod(CreateMoreGears.MOD_ID) | ||
public class CreateMoreGears { | ||
|
||
private static final NonNullLazyValue<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(CreateMoreGears.MOD_ID); | ||
|
||
public static final String MOD_ID = "createmoregears"; | ||
public static final String MOD_NAME = "Create: More Gears"; | ||
public static final Logger LOGGER = LogManager.getLogger(); | ||
public static CreateMoreGears INSTANCE; | ||
|
||
public final ModTiles tiles; | ||
public final ModTags tags; | ||
public final ModBlocks blocks; | ||
@SuppressWarnings("deprecation") | ||
public static CreateRegistrate getRegistrate() { | ||
return REGISTRATE.get(); | ||
} | ||
|
||
public CreateMoreGears() { | ||
INSTANCE = this; | ||
|
||
@SuppressWarnings("deprecation") | ||
CreateRegistrate registrate = CreateRegistrate.lazy(CreateMoreGears.MOD_ID).get(); | ||
|
||
ItemGroup itemGroup = new ItemGroup(CreateMoreGears.MOD_ID) { | ||
@Override | ||
public ItemStack makeIcon() { | ||
return new ItemStack(blocks.wormGear.get()); | ||
} | ||
}; | ||
registrate = registrate.itemGroup(() -> itemGroup); | ||
|
||
tags = new ModTags(); | ||
blocks = new ModBlocks(registrate, tags); | ||
tiles = new ModTiles(registrate, blocks); | ||
ModItemGroups.register(); | ||
ModBlocks.register(); | ||
ModTiles.register(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/main/java/me/ci/moregears/blocks/ballista/BallistaBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package me.ci.moregears.blocks; | ||
|
||
import com.simibubi.create.content.contraptions.base.KineticBlock; | ||
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel; | ||
import com.simibubi.create.foundation.block.ITE; | ||
|
||
import me.ci.moregears.registry.ModTiles; | ||
import me.ci.moregears.tiles.BallistaTile; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.Direction; | ||
import net.minecraft.util.Direction.Axis; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockReader; | ||
import net.minecraft.world.IWorldReader; | ||
|
||
public class BallistaBlock extends KineticBlock implements ITE<BallistaTile>, ICogWheel { | ||
|
||
public BallistaBlock(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public Axis getRotationAxis(BlockState state) { | ||
return Axis.Y; | ||
} | ||
|
||
@Override | ||
public TileEntity createTileEntity(BlockState state, IBlockReader world) { | ||
return ModTiles.BALLISTA.create(); | ||
} | ||
|
||
@Override | ||
public Class<BallistaTile> getTileEntityClass() { | ||
return BallistaTile.class; | ||
} | ||
|
||
@Override | ||
public boolean hasShaftTowards(IWorldReader world, BlockPos pos, BlockState state, Direction face) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public SpeedLevel getMinimumRequiredSpeedLevel() { | ||
return SpeedLevel.of(8); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/me/ci/moregears/blocks/ballista/BallistaCog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package me.ci.moregears.blocks.ballista; | ||
|
||
import com.jozufozu.flywheel.backend.instancing.Instancer; | ||
import com.jozufozu.flywheel.backend.material.MaterialManager; | ||
import com.simibubi.create.content.contraptions.base.KineticTileEntity; | ||
import com.simibubi.create.content.contraptions.base.RotatingData; | ||
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; | ||
|
||
public class BallistaCog extends SingleRotatingInstance { | ||
|
||
public BallistaCog(MaterialManager<?> modelManager, KineticTileEntity tile) { | ||
super(modelManager, tile); | ||
} | ||
|
||
// @Override | ||
// protected Instancer<RotatingData> getModel() { | ||
// return getRotatingMaterial().getModel(ModBlockPartials.BALLISTA_COGWHEEL, | ||
// tile.getBlockState()); | ||
// } | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/me/ci/moregears/registry/ModBlockPartials.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package me.ci.moregears.registry; | ||
|
||
import com.jozufozu.flywheel.core.PartialModel; | ||
|
||
import me.ci.moregears.CreateMoreGears; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
public final class ModBlockPartials { | ||
|
||
public static final PartialModel BALLISTA_COGWHEEL = get("ballista/cogwheel"); | ||
|
||
private static PartialModel get(String path) { | ||
ResourceLocation loc = new ResourceLocation(CreateMoreGears.MOD_ID, "block/" + path); | ||
return new PartialModel(loc); | ||
} | ||
|
||
public static void register() { | ||
// Load static fields | ||
} | ||
|
||
private ModBlockPartials(){ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.ci.moregears.registry; | ||
|
||
import me.ci.moregears.CreateMoreGears; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public final class ModItemGroups { | ||
|
||
public static final ItemGroup DEFAULT_GROUP = new ItemGroup(CreateMoreGears.MOD_ID) { | ||
@Override | ||
public ItemStack makeIcon() { | ||
return ModBlocks.WORM_GEAR.asStack(); | ||
} | ||
}; | ||
|
||
public static void register() { | ||
// Load static fields | ||
} | ||
|
||
private ModItemGroups() { | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.