Skip to content

Commit

Permalink
Blacklist Create entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jul 9, 2023
1 parent d90ba60 commit e1d8dc6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ PortalCubedBlocks.REFLECTION_GEL, id("textures/block/reflection_gel.png")
.build();

public static final TagKey<EntityType<?>> P1_ENTITY = TagKey.create(Registries.ENTITY_TYPE, id("p1_entity"));
public static final TagKey<EntityType<?>> PORTAL_BLACKLIST = TagKey.create(Registries.ENTITY_TYPE, id("portal_blacklist"));

public static void registerEntities() {
Registry.register(BuiltInRegistries.ENTITY_TYPE, id("portal"), PORTAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.fusionflux.portalcubed.entity.CorePhysicsEntity;
import com.fusionflux.portalcubed.entity.GelBlobEntity;
import com.fusionflux.portalcubed.entity.Portal;
import com.fusionflux.portalcubed.entity.PortalCubedEntities;
import com.fusionflux.portalcubed.items.PortalCubedItems;
import com.fusionflux.portalcubed.listeners.WentThroughPortalListener;
import com.fusionflux.portalcubed.mechanics.CrossPortalInteraction;
Expand Down Expand Up @@ -181,7 +182,7 @@ public void tick(CallbackInfo ci) {

Entity thiz = (Entity) (Object) this;

if (!(thiz instanceof Player) && !(thiz instanceof Portal)) {
if (!(thiz instanceof Player) && !(thiz instanceof Portal) && !thiz.getType().is(PortalCubedEntities.PORTAL_BLACKLIST)) {
GeneralUtil.setupPortalShapes(thiz);
}

Expand Down Expand Up @@ -233,12 +234,11 @@ public void tick(CallbackInfo ci) {
prevGravDirec = GravityChangerAPI.getGravityDirection(((Entity) (Object) this));
}


@Inject(method = "tick", at = @At("TAIL"))
public void tickTail(CallbackInfo ci) {
Entity thisEntity = ((Entity) (Object) this);

if (!thisEntity.level().isClientSide() && !(thisEntity instanceof Player) && !(thisEntity instanceof Portal)) {
if (!thisEntity.level().isClientSide() && !(thisEntity instanceof Player) && !(thisEntity instanceof Portal) && !thisEntity.getType().is(PortalCubedEntities.PORTAL_BLACKLIST)) {
Vec3 entityVelocity = this.getDeltaMovement();


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"replace": false,
"values": [
{
"id": "create:stationary_contraption",
"required": false
},
{
"id": "create:gantry_contraption",
"required": false
},
{
"id": "create:carriage_contraption",
"required": false
},
{
"id": "create:super_glue",
"required": false
}
]
}

0 comments on commit e1d8dc6

Please sign in to comment.